// 上传文件
let upLoadSendFile = function(file, obj, id) {
    var data = new FormData();
    data.append("file", file);
    $.ajax({
        type: "POST",
        url: ctx + "common/upload",
        data: data,
        cache: false,
        contentType: false,
        processData: false,
        dataType: 'json',
        async: false,
        success: function(result) {
            if (result.code == web_status.SUCCESS) {
                if (obj!=null){
                    $(obj).summernote('editor.insertImage', result.url, result.fileName);
                }else{
                    $(id).val(result.url);
                }
            } else {
                $.modal.alertError(result.msg);
            }
        },
        error: function(error) {
            $.modal.alertWarning("图片上传失败。");
        }
    });
}